home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 January to June / Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64 / math master (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  9KB  |  277 lines

  1. 5 rem--ahoy--may issue--math master--prog page 65
  2. 10 rem ****** math master ******               ***** by bob lloret *****
  3. 15 rem ** for  ahoy magazines **
  4. 20 rem *************************
  5. 90 lev=0:t=0:prob=0
  6. 100 print "[147]":poke 53280,6:poke 53281,0
  7. 110 print "[158]":print tab(11);"[145][176][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][174]"
  8. 120 print tab(11);"[194]*  math master  *[194]"
  9. 130 print tab(11);"[173][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][189]"
  10. 140 print:print tab(13);"by: bob lloret":print:print
  11. 150 print "[158][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168][168]"
  12. 160 print tab(11);"[145][145][145][145][154]first name:";:input name$
  13. 161 if name$="" then print "":goto160
  14. 162 for a=1 to 2:print:next a
  15. 165 s=54272:for l=0 to 24:poke s+l,0:next
  16. 166 poke s+1,22:poke s,96:poke s+5,10:poke s+24,10:poke s+4,33
  17. 170 print tab(11);"[1]..addition":print:print tab(11);"[156][2]..subtraction"
  18. 180 print:print tab(11);"[3]..multiplication"
  19. 190 print:print tab(11);"[149][4]..division"
  20. 200 print:print "[158]    [168][168][168][168][168]    [168][168][168][168][168]    [168][168][168][168][168]    [168][168][168][168][168]  "
  21. 205 print
  22. 210 print tab(11);"your choice [1-4]?"
  23. 220 get choice$:if choice$="" then 220
  24. 225 rem [***  player level  ***]
  25. 226 rem ========================
  26. 230 print "[147]":poke 53280,0:poke 53281,4
  27. 240 print tab(9);"[158][168][168][168][168] player level [168][168][168][168]":print tab(14);"[168][168][168][168][168][168][168][168][168][168][168][168]"
  28. 250 for a=1 to 5:print:next a
  29. 260 print tab(11);"[144][1]..ages 6 to 9":print:print tab(11);"[2]..ages 10 to 14"
  30. 270 print:print tab(11);"[3]..ages 15 to adult":for a=1 to 6:print:next a
  31. 280 print tab(12);"your choice [1-3]?"
  32. 290 get lev$:if lev$="" then 290
  33. 300 lev=val(lev$):choice=val(choice$)
  34. 310 if lev=1 then v=10:dig=1:t=15:goto 360
  35. 320 if lev=2 then v=50:dig=10:t=12:goto 360
  36. 330 if lev=3 then v=100:dig=25:t=10:goto 360
  37. 360 on choice goto 500,1000,1500,2000
  38. 497 rem
  39. 498 rem [ ****  addition  **** ]
  40. 499 rem ========================
  41. 500 print "[147]":poke 53280,0:poke 53281,5
  42. 510 print tab(11);"[144]* a d d i t i o n *":print:print tab(17);"level";lev
  43. 520 prob=prob+1:x=int(rnd(0)*v)+dig:y=int(rnd(0)*v)+dig
  44. 530 print tab(15);"problem:";prob
  45. 540 for a=1 to 3:print:next a
  46. 550 print "[144]       [176][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][174]"
  47. 560 print "       [194]                         [194]"
  48. 570 print "       [194]                         [194]"
  49. 580 print "       [194]                         [194]"
  50. 590 print "       [173][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][189]"
  51. 595 for d=1 to 500:next d
  52. 600 for l=0 to 24:poke s+l,0:next
  53. 605 poke s+1,33:poke s,135:poke s+5,9:poke s+24,10:poke s+4,33
  54. 610 print tab(11);"[145][145][145]";x;" + ";y;" = "
  55. 620 ti$="000000":b=0:z=12
  56. 630 b=b+1:for a=1 to z:print:next
  57. 640 get an$(b):print tab(16);"[144][145]time:";"[156]";int(ti/60)
  58. 645 if int(ti/60)>=t then 850
  59. 650 if an$(b)="" then 640
  60. 660 print tab(24+b);"[145][145][145][145][145][145][145][145][145][145][145][145][145]";an$(b):if an$(b)=chr$(13) then 670
  61. 665 goto 630
  62. 670 a$=an$(1)+an$(2)+an$(3)
  63. 675 ans=val(a$):if ans<>x+y then 780
  64. 680 cent=int(40-len("correct"+name$))/2
  65. 690 print tab(cent);"[158]correct ";name$;","
  66. 700 for a=10 to 0 step -1:poke 53280,a:for d=1 to 100:next d:next a:c=c+1
  67. 710 print tab(13);"you now have ";c
  68. 720 print tab(13);"correct answers"
  69. 730 for d=1 to 2400:next d
  70. 740 if prob=10 then 3000
  71. 750 goto 500
  72. 760 rem [ * wrong answer * ]
  73. 770 rem ====================
  74. 780 cent=int(40-len("sorry"+name$))/2
  75. 785 for l=0 to 24:poke s+l,0:next:poke s+1,4:poke s,48
  76. 787 poke s+5,10:poke s+24,15:poke s+4,33
  77. 790 print tab(cent);"sorry ";name$;","
  78. 800 print tab(11);"but the answer is...":print tab(18);"";x+y
  79. 810 for d=1 to 2400:next d
  80. 820 if prob=10 then 3000
  81. 830 goto 500
  82. 840 rem [ *** time limit *** ]
  83. 841 rem ======================
  84. 850 cent=int(40-len("sorry"+name$))/2
  85. 855 for l=0 to 24:poke s+l,0:next:poke s+1,4:poke s,48
  86. 857 poke s+5,10:poke s+24,15:poke s+4,33
  87. 860 print tab(cent);"[145][145][145][145][145][145][145][145][145]sorry";name$;","
  88. 870 print tab(11);"but the answer is...":print tab(18);"";x+y
  89. 880 for d=1 to 2400:next d
  90. 890 if prob=10 then 3000
  91. 900 goto 500
  92. 997 rem
  93. 998 rem [ *** subtraction *** ]
  94. 999 rem =======================
  95. 1000 print "[147]":poke 53280,0:poke 53281,8
  96. 1010 print tab(8);"[144]* s u b t r a c t i o n *":print:print tab(17);"level";lev
  97. 1020 prob=prob+1:x=int(rnd(0)*v)+dig+v:y=int(rnd(0)*v)+1
  98. 1030 print tab(15);"problem:";prob
  99. 1040 for a=1 to 3:print:next a
  100. 1050 print "[144]       [176][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][174]"
  101. 1060 print "       [194]                         [194]"
  102. 1070 print "       [194]                         [194]"
  103. 1080 print "       [194]                         [194]"
  104. 1090 print "       [173][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][189]"
  105. 1095 for d=1 to 500:next d
  106. 1100 for l=0 to 24:poke s+l,0:next
  107. 1105 poke s+1,33:poke s,135:poke s+5,9:poke s+24,10:poke s+4,33
  108. 1110 print tab(11);"[145][145][145]";x;" - ";y;" = "
  109. 1120 ti$="000000":b=0:z=12
  110. 1130 b=b+1:for a=1 to z:print:next
  111. 1140 get an$(b):print tab(16);"[144][145]time:";"";int(ti/60)
  112. 1145 if int(ti/60)>=t then 1350
  113. 1150 if an$(b)="" then 1140
  114. 1160 print tab(25+b);"[145][145][145][145][145][145][145][145][145][145][145][145][145]";an$(b):if an$(b)=chr$(13) then 1170
  115. 1165 goto 1130
  116. 1170 a$=an$(1)+an$(2)+an$(3)
  117. 1175 ans=val(a$):if ans<>x-y then 1275
  118. 1180 cent=int(40-len("correct"+name$))/2
  119. 1190 print tab(cent);"[158]correct ";name$;","
  120. 1200 for a=10 to 0 step -1:poke 53280,a:for d=1 to 120:next d:next a:c=c+1
  121. 1210 print tab(13);"you now have ";c
  122. 1220 print tab(13);"correct answers"
  123. 1230 for d=1 to 2400:next d
  124. 1240 if prob=10 then 3000
  125. 1250 goto 1000
  126. 1260 rem [ * wrong answer * ]
  127. 1270 rem ====================
  128. 1275 for l=0 to 24:poke s+l,0:next:poke s+1,4:poke s,48
  129. 1277 poke s+5,10:poke s+24,15:poke s+4,33
  130. 1280 cent=int(40-len("sorry"+name$))/2
  131. 1290 print tab(cent);"[153]sorry ";name$;","
  132. 1300 print tab(11);"but the answer is...":print tab(18);"";x-y
  133. 1310 for  d=1 to 2400:next d
  134. 1320 if prob=10 then 3000
  135. 1330 goto 1000
  136. 1340 rem [ *** time limit *** ]
  137. 1341 rem ======================
  138. 1350 cent=int(40-len("sorry"+name$))/2
  139. 1360 print tab(cent);"[145][145][145][145][145][145][145][145][145]sorry ";name$;","
  140. 1370 print tab(11);"but the answer is...":print tab(18);"";x-y
  141. 1380 for d=1 to 2400:next d
  142. 1390 if prob=10 then 3000
  143. 1400 goto 1000
  144. 1500 print "[147]":poke 53280,0:poke 53281,6
  145. 1510 print tab(11);"[144]* m u l t i p l y *":print:print tab(17);"[158]level";lev
  146. 1520 prob=prob+1:x=int(rnd(0)*v)+dig:y=int(rnd(0)*v)+dig
  147. 1530 print tab(15);"[158]problem:";prob
  148. 1540 for a=1 to 3:print:next a
  149. 1550 print "[144]       [176][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][174]"
  150. 1560 print "       [194]                         [194]"
  151. 1570 print "       [194]                         [194]"
  152. 1580 print "       [194]                         [194]"
  153. 1590 print "       [173]                         [189]"
  154. 1595 for d=1 to 500:next d
  155. 1600 for l=0 to 24:poke s+l,0:next
  156. 1605 poke s+1,33:poke s,135:poke s+5,9:poke s+24,10:poke s+4,33
  157. 1610 print tab(11);"[145][145][145]";x;" x ";y;" = "
  158. 1620 ti$="000000":b=0:z=12
  159. 1630 b=b+1:for a=1 to z:print:next
  160. 1640 get an$(b):print tab(16);"[144][145]time:";"[156]";int(ti/60)
  161. 1645 if int(ti/60)>=t then 1850
  162. 1650 if an$(b)="" then 1640
  163. 1660 print tab(24+b);"[145][145][145][145][145][145][145][145][145][145][145][145][145]";an$(b):if an$(b)=chr$(13) then 1670
  164. 1665 goto 1630
  165. 1670 a$=an$(1)+an$(2)+an$(3)
  166. 1675 ans=val(a$):if ans<>x*y then 1780
  167. 1680 cent=int(40-len("correct"+name$))/2
  168. 1690 print tab(cent);"[158]correct ";name$;","
  169. 1700 for a=10 to 0 step -1:poke 53280,a:for d=1 to 100:next d:next a:c=c+1
  170. 1710 print tab(13);"you now have ";c
  171. 1720 print tab(13);"correct answers"
  172. 1730 for d=1 to 2400:next d
  173. 1740 if prob=10 then 3000
  174. 1750 goto 1500
  175. 1760 rem [ * wrong answer * ]
  176. 1770 rem ====================
  177. 1780 cent=int(40-len("sorry"+name$))/2
  178. 1785 for l=0 to 24:poke s+l,0:next:poke s+1,4:poke s,48
  179. 1787 poke s+5,10:poke s+24,15:poke s+4,33
  180. 1790 print tab(cent);"sorry ";name$;","
  181. 1800 print tab(11);"but the answer is...":print tab(18);"";x*y
  182. 1810 for d=1 to 2400:next d
  183. 1820 if prob=10 then 3000
  184. 1830 goto 1500
  185. 1840 rem [ *** time limit *** ]
  186. 1841 rem ======================
  187. 1850 cent=int(40-len("sorry"+name$))/2
  188. 1855 for l=0 to 24:poke s+l,0:next:poke s+1,4:poke s,48
  189. 1857 poke s+5,10:poke s+24,15:poke s+4,33
  190. 1860 print tab(cent);"[145][145][145][145][145][145][145][145][145]sorry ";name$;","
  191. 1870 print tab(11);"but the answer is...":print tab(18);"";x*y
  192. 1880 for d=1 to 2400:next d
  193. 1890 if prob=10 then 3000
  194. 1900 goto 1500
  195. 2000 print "[147]":poke 53280,6:poke 53281,9
  196. 2010 print tab(11);"[144]* d i v i s i o n *":print:print tab(17);"[158]level";lev
  197. 2020 prob=prob+1:w=int(rnd(0)*v)+dig:y=int(rnd(0)*10)+1
  198. 2030 print tab(15);"[158]problem:";prob
  199. 2040 for a=1 to 3:print:next a
  200. 2050 print "[144]       [176][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][174]"
  201. 2060 print "       [194]                         [194]"
  202. 2070 print "       [194]                         [194]"
  203. 2080 print "       [194]                         [194]"
  204. 2090 print "       [173]                         [189]"
  205. 2095 for d=1 to 500:next d
  206. 2100 for l=0 to 24:poke s+l,0:next
  207. 2105 poke s+1,33:poke s,135:poke s+5,9:poke s+24,10:poke s+4,33
  208. 2110 x=int(w*y)
  209. 2115 print tab(11);"[145][145][145]";x;" / ";y;" = "
  210. 2120 ti$="000000":b=0:z=12
  211. 2130 b=b+1:for a=1 to z:print:next
  212. 2140 get an$(b):print tab(16);"[144][145]time:";"[156]";int(ti/60)
  213. 2145 if int(ti/60)>=t then 2350
  214. 2150 if an$(b)="" then 2140
  215. 2160 print tab(24+b);"[145][145][145][145][145][145][145][145][145][145][145][145][145]";an$(b):if an$(b)=chr$(13) then 2170
  216. 2165 goto 2130
  217. 2170 a$=an$(1)+an$(2)+an$(3)
  218. 2175 ans=val(a$):if ans<>int(x/y) then 2280
  219. 2180 cent=int(40-len("correct"+name$))/2
  220. 2190 print tab(cent);"[158]correct ";name$;","
  221. 2200 for a=10 to 0 step -1:poke 53280,a:for d=1 to 100:next d:next a:c=c+1
  222. 2210 print tab(13);"you now have ";c
  223. 2220 print tab(13);"correct answers"
  224. 2230 for d=1 to 2400:next d
  225. 2240 if prob=10 then 3000
  226. 2250 goto 2000
  227. 2260 rem [ * wrong answer * ]
  228. 2270 rem ====================
  229. 2280 cent=int(40-len("sorry"+name$))/2
  230. 2285 for l=0 to 24:poke s+l,0:next:poke s+1,4:poke s,48
  231. 2287 poke s+5,10:poke s+24,15:poke s+4,33
  232. 2290 print tab(cent);"sorry ";name$;","
  233. 2300 print tab(11);"but the answer is...":print tab(18);"";x/y
  234. 2310 for d=1 to 2400:next d
  235. 2320 if prob=10 then 3000
  236. 2330 goto 2000
  237. 2340 rem [ *** time limit *** ]
  238. 2345 rem ======================
  239. 2350 cent=int(40-len("sorry"+name$))/2
  240. 2355 for l=0 to 24:poke s+l,0:next:poke s+1,4:poke s,48
  241. 2357 poke s+5,10:poke s+24,15:poke s+4,33
  242. 2360 print tab(cent);"[145][145][145][145][145][145][145][145][145]sorry ";name$;","
  243. 2370 print tab(11);"but the answer is...":print tab(18);"";x/y
  244. 2380 for d=1 to 2400:next d
  245. 2390 if prob=10 then 3000
  246. 2400 goto 2000
  247. 3000 rem *** final results ***
  248. 3010 rem =====================
  249. 3020 print "[147]":poke 53280,2:poke 53281,15
  250. 3030 print tab(8);"[168][168][168][168][168] r e s u l t s [168][168][168][168][168]"
  251. 3035 print tab(12);"&[168][168][168][168][168][168][168][168][168][168][168][168][168][168][168]&"
  252. 3040 print tab(10);"you scored ";c;"out of"
  253. 3050 print tab(15);"10 correct"
  254. 3060 p=int(c*100)/10
  255. 3070 print tab(11);"for a mark of ";p;"%"
  256. 3080 print "    [168][168][168][168][168]    [168][168][168][168][168]    [168][168][168][168][168]    [168][168][168][168][168]"
  257. 3085 for d=1 to 2000:next d
  258. 3090 if p<=60 then 3120
  259. 3100 if p<=90 then 3150
  260. 3110 if p>90 then 3180
  261. 3120 cent=int(40-len("come on"+name$))/2
  262. 3130 print tab(cent);"come on ";name$;",":print tab(12);"i know you can do"
  263. 3140 print tab(12);"better than that":goto 3220
  264. 3150 cent=int(40-len("not bad"+name$))/2
  265. 3160 print tab(cent);"not bad ";name$;","
  266. 3170 print tab(11);"i think you should":print tab(11);"try a little harder"
  267. 3175 goto 3220
  268. 3180 cent=int(40-len("congratulations"+name$))/2:for a=1 to 3:print:next a
  269. 3185 for a=1 to 7:print tab(cent);"[145]congratulations ";name$;","
  270. 3190 ford=1 to 200:next d:print tab(cent);"[145]congratulations ";name$;","
  271. 3195 for d=1 to 200:next d:next a
  272. 3200 print tab(12);"you got a perfect":print tab(16);"score !!!"
  273. 3220 print tab(12);"try again [y/n]?";
  274. 3230 get x$:if x$="" then 3230
  275. 3240 if x$<>"y" then end
  276. 3250 goto 90
  277.